
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
%>
<html>
<head>
	<base href="<%=basePath%>">

<meta charset="UTF-8">
<link href="jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="jquery/jquery-1.11.1-min.js"></script>
<script type="text/javascript" src="jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
<style type="text/css">
body{
    background-color: #00007f;
    }
	h1{
		color: #0000ff;
	}
	span{
		color: #aa00ff;
	}
	h2{
		color: #aaffff;
	}
::-webkit-input-placeholder {
	color: #CCCCCC;
}
</style>
	<script type="text/javascript">
		$(function(){
			$(window).keydown(function (event){
				if (event.keyCode == 13){
					$("#loginBtn").click();  //  无参   代码触发单击
				}
			})
			$("#loginBtn").click(function (){
				var loginAct = $.trim($("#loginAct").val());
				var loginPwd = $.trim($("#loginPwd").val());
				var isRemPwd = $("#isRemPwd").prop("checked");
				// console.log(isRemPwd);
				//表单验证
				if(loginAct == ""){
					alert("用户名不能为空");
					return;
				}
				if (loginPwd == ""){
					alert("密码不能为空");
					return;
				}
			    $("#msg").text("请耐心等待...正在验证")
				$.ajax({
					url:"settings/qx/user/login.do",
					data:{
						loginAct:loginAct,
						loginPwd:loginPwd,
						isRemPwd:isRemPwd
					},
					type:'post',
					dataType:'json',
					success:function (data) {
						if (data.code == "1"){
                            $("#msg").html(data.message)
							//成功跳转到业务主页面
							window.location.href="workbench/index.do";
						}else if (data.code == "0"){
							$("#msg").html(data.message)
							alert(data.message);
						}
					},
					beforeSend:function (){ // ajax向后台发请求之前  会自动执行  有返回值  布尔值
						//  表单验证
						$("#msg").text("请耐心等待...正在验证");
						return true;
					}
				})
			});
		});
	</script>
</head>
<body>
	<div style="position: absolute; top: 0px; left: 0px; width: 100%;">
		<img src="image/tipian.jpg" style="width:100%; height:700px; position: relative; top: 50px;">
	</div>
	<div id="top" style="height: 50px; background-color: #000000; width: 100%;">
		<div style="position: absolute; top: 5px; left: 0px; font-size: 30px; font-weight: 400; color: white; font-family: 'times new roman'">XIAONIECRM&nbsp;<span style="font-size: 12px;">&copy;2022&nbsp;浅红QIANHONG</span><span></span></div>
	</div>
	<div style="position: absolute; top: 120px; right: 40%;width:30%;height:30%;filter: alpha(opacity=0	);">
<%--		<span style="background:none;color: #000000">sdfsdfdsf</span><br>--%>
	<%--	<audio controls >  &lt;%&ndash;controls&ndash;%&gt;
			<source src="Music/music-tongnian.mp3" type="audio/mp3" style="background:none;filter: alpha(opacity=0);">
			<!--音乐文件路径自己写-->
		</audio>--%>
    <audio style="display: none" id="mp3audio" controls="controls" src="Music/music-tongnian.mp3">
        <source src="Music/music-tongnian.mp3" type="audio/mpeg" id="beijingyine">
    </audio>

	</div>
	<div style="position: absolute; top: 120px; right: 100px;width:450px;height:400px;border:1px ">
		<div style="position: absolute; top: 0px; right: 60px;">
			<div class="page-header">
				<h2>QQ登录 / 微信登录</h2>
			</div>
			<form action="" class="form-horizontal" role="form">
				<div class="form-group form-group-lg">
					<div style="width: 350px;">
						<input class="form-control" id="loginAct" type="text" value="${cookie.loginAct.value}" placeholder="用户名" style="background:none">
					</div>
					<div style="width: 350px; position: relative;top: 20px;">
						<input class="form-control" id="loginPwd" type="password" value="${cookie.loginPwd.value}" placeholder="密码" style="background:none">
					</div>
					<div class="checkbox"  style="position: relative;top: 30px; left: 10px;">
						<label>
							<c:if test="${not empty cookie.loginAct and not empty cookie.loginPwd}">
								<input type="checkbox" id="isRemPwd" checked>
							</c:if>
							<c:if test="${empty cookie.loginAct or empty cookie.loginPwd}">
								<input type="checkbox" id="isRemPwd">
							</c:if>
							 <span id="s1">记住密码</span>
						</label>
						&nbsp;&nbsp;
						<span id="msg"></span>
					</div>
					<button type="button" id="loginBtn" class="btn btn-primary btn-lg btn-block"  style="width: 150px; position: relative;top: 45px;background:none;">登录</button>
					<a type="button" href="index01.jsp" class="btn btn-primary btn-lg btn-block" style="width: 150px; position: relative;top: 45px;background:none;">注册</a>
		        </div>
			</form>
		</div>
	</div>
</body>
</html>
